"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LogServerHelper = void 0;
const ServerConfig_1 = require("../src/config/ServerConfig");
const DateUtil_1 = require("../src/engine/utils/DateUtil");
const HttpUtil_1 = require("../src/engine/utils/HttpUtil");
const LogMethodConfig_1 = require("./LogMethodConfig");
class LogServerHelper {
    static sendLog(method, params) {
        let log_server = ServerConfig_1.ServerConfig.randomLogServer();
        HttpUtil_1.HttpUtil.request_by_body(log_server.getInternalUrl() + method, params);
    }
    static log_club_in_out_history(clubid, userid, in_out_type, handle_userid) {
        let logParam = {
            "clubid": clubid,
            "userid": userid,
            "handle_userid": handle_userid,
            "in_out_type": in_out_type,
            "time": DateUtil_1.default.formatDateStr(DateUtil_1.default.now()),
        };
        LogServerHelper.sendLog(LogMethodConfig_1.LogMethodConfig.method_type.club_in_out_history, logParam);
    }
    static log_club_top(clubid, userid, score, wintimes = 0, gametimes = 1) {
        let logParam = {
            "clubid": clubid,
            "userid": userid,
            "score": score,
            "wintimes": wintimes,
            "gametimes": gametimes,
        };
        LogServerHelper.sendLog(LogMethodConfig_1.LogMethodConfig.method_type.club_top, logParam);
    }
    static log_club_freeze_history(clubid, freezeid, handleid, freeze_type) {
        let logParam = {
            "clubid": clubid,
            "freezeid": freezeid,
            "handleid": handleid,
            "freeze_type": freeze_type,
        };
        LogServerHelper.sendLog(LogMethodConfig_1.LogMethodConfig.method_type.club_freeze_history, logParam);
    }
    static log_insert_give_history(sender, reciver, type, num) {
        let logParam = {
            "sender": sender,
            "reciver": reciver,
            "type": type,
            "num": num,
            "time": DateUtil_1.default.formatDateStr(DateUtil_1.default.now()),
        };
        LogServerHelper.sendLog(LogMethodConfig_1.LogMethodConfig.method_type.insert_give_history, logParam);
    }
    static log_add_user_spend_daily(userid, type, cost) {
        let logParam = {
            "userid": userid,
            "type": type,
            "cost": cost,
        };
        LogServerHelper.sendLog(LogMethodConfig_1.LogMethodConfig.method_type.add_user_spend_daily, logParam);
    }
    static log_add_user_gems_history(userid, gems, left_gems, reseason, detail) {
        let logParam = {
            "userid": userid,
            "gems": gems,
            "left_gems": left_gems,
            "reseason": reseason,
            "detail": detail,
            "time": DateUtil_1.default.formatDateStr(DateUtil_1.default.now()),
        };
        LogServerHelper.sendLog(LogMethodConfig_1.LogMethodConfig.method_type.add_user_gems_history, logParam);
    }
    static log_add_user_coins_history(userid, coins, left_coins, reseason, detail) {
        let logParam = {
            "userid": userid,
            "coins": coins,
            "left_coins": left_coins,
            "reseason": reseason,
            "detail": detail,
            "time": DateUtil_1.default.formatDateStr(DateUtil_1.default.now()),
        };
        LogServerHelper.sendLog(LogMethodConfig_1.LogMethodConfig.method_type.add_user_coins_history, logParam);
    }
    static log_add_user_income_history(userid, income, left_income, reaeason, detail) {
    }
    static log_add_user_meilis_history(userid, meilis, left_meilis, reseason, detail) {
        let logParam = {
            "userid": userid,
            "meilis": meilis,
            "left_meilis": left_meilis,
            "reseason": reseason,
            "detail": detail,
            "time": DateUtil_1.default.formatDateStr(DateUtil_1.default.now()),
        };
        LogServerHelper.sendLog(LogMethodConfig_1.LogMethodConfig.method_type.add_user_meilis_history, logParam);
    }
    static log_room_statistics(room_id, clubid, time) {
        if (clubid > 0) {
            let logParam = {
                "room_id": room_id,
                "clubid": clubid,
                "time": time
            };
            LogServerHelper.sendLog(LogMethodConfig_1.LogMethodConfig.method_type.add_room_statistics, logParam);
        }
    }
}
exports.LogServerHelper = LogServerHelper;
